home *** CD-ROM | disk | FTP | other *** search
- unit GLAux;
-
- interface
-
- uses Windows, OpenGL;
-
- const
- // ToolKit Window Types
- Aux_RGB = 0;
- Aux_RGBA = Aux_RGB;
- Aux_Index = 1;
- Aux_Single = 0;
- Aux_Double = 2;
- Aux_Direct = 0;
- Aux_Indirect = 4;
-
- Aux_Accum = 8;
- Aux_Alpha = 16;
- Aux_Depth24 = 32; // 24-bit depth buffer
- Aux_Stencil = 64;
- Aux_Aux = 128;
- Aux_Depth16 = 256; // 16-bit depth buffer
- Aux_Fixed_332_Pal = 512;
- Aux_Depth = Aux_Depth16; // default is 16-bit depth buffer
-
- // Color Macros
- Aux_Black = 0;
- Aux_Red = 13;
- Aux_Green = 14;
- Aux_Yellow = 15;
- Aux_Blue = 16;
- Aux_Magenta = 17;
- Aux_Cyan = 18;
- Aux_White = 19;
-
- procedure auxInitDisplayMode (mode: GLenum); stdcall;
- procedure auxInitPosition (x, y, width, height: Integer); stdcall;
- procedure auxInitWindow (Title: PAnsiChar); stdcall;
- procedure auxSwapBuffers; stdcall;
- procedure auxReshapeFunc (ReshapeFunc: Pointer); stdcall;
- procedure auxIdleFunc (IdleFunc: Pointer); stdcall;
- procedure auxMainLoop (MainFunc: Pointer); stdcall;
- procedure auxWireSphere (radius: GLDouble); stdcall;
- procedure auxSolidSphere (radius: GLDouble); stdcall;
- procedure auxWireCube (size: GLDouble); stdcall;
- procedure auxSolidCube (size: GLDouble); stdcall;
- procedure auxWireBox (width, height, depth: GLDouble); stdcall;
- procedure auxSolidBox (width, height, depth: GLDouble); stdcall;
- procedure auxWireTorus (innerRadius, outerRadius: GLDouble); stdcall;
- procedure auxSolidTorus (innerRadius, outerRadius: GLDouble); stdcall;
- procedure auxWireCylinder (radius, height: GLDouble); stdcall;
- procedure auxSolidCylinder (radius, height: GLDouble); stdcall;
- procedure auxWireCone (base, height: GLDouble); stdcall;
- procedure auxSolidCone (base, height: GLDouble); stdcall;
- procedure auxWireIcosahedron (radius: GLDouble); stdcall;
- procedure auxSolidIcosahedron (radius: GLDouble); stdcall;
- procedure auxWireOctahedron (radius: GLDouble); stdcall;
- procedure auxSolidOctahedron (radius: GLDouble); stdcall;
- procedure auxWireTetrahedron (radius: GLDouble); stdcall;
- procedure auxSolidTetrahedron (radius: GLDouble); stdcall;
- procedure auxWireDodecahedron (radius: GLDouble); stdcall;
- procedure auxSolidDodecahedron (radius: GLDouble); stdcall;
- procedure auxWireTeapot (size: GLdouble); stdcall;
- procedure auxSolidTeapot (size: GLdouble); stdcall;
- procedure auxCloseWindow; stdcall;
- procedure auxQuit; stdcall;
- procedure auxSetGreyRamp; stdcall;
- function auxGetDisplayModePolicy: GLEnum; stdcall;
- function auxGetDisplayModeID: Integer; stdcall;
- function auxGetDisplayMode: GLEnum; stdcall;
- procedure auxCreateFont; stdcall;
- function auxGetColorMapSize: Integer; stdcall;
- function auxGetHWND: hWnd; stdcall;
- function auxGetHDC: hDC; stdcall;
- function auxGetHGLRC: hGLRC; stdcall;
-
- implementation
-
- const
- auxlib = 'glaux.dll';
-
- procedure auxInitDisplayMode; external auxlib;
- procedure auxInitPosition; external auxlib;
- procedure auxSwapBuffers; external auxlib;
- procedure auxReshapeFunc; external auxlib;
- procedure auxIdleFunc; external auxlib;
- procedure auxMainLoop; external auxlib;
- procedure auxWireSphere; external auxlib;
- procedure auxSolidSphere; external auxlib;
- procedure auxWireCube; external auxlib;
- procedure auxSolidCube; external auxlib;
- procedure auxWireBox; external auxlib;
- procedure auxSolidBox; external auxlib;
- procedure auxWireTorus; external auxlib;
- procedure auxSolidTorus; external auxlib;
- procedure auxWireCylinder; external auxlib;
- procedure auxSolidCylinder; external auxlib;
- procedure auxWireCone; external auxlib;
- procedure auxSolidCone; external auxlib;
- procedure auxWireIcosahedron; external auxlib;
- procedure auxSolidIcosahedron; external auxlib;
- procedure auxWireOctahedron; external auxlib;
- procedure auxSolidOctahedron; external auxlib;
- procedure auxWireTetrahedron; external auxlib;
- procedure auxSolidTetrahedron; external auxlib;
- procedure auxWireDodecahedron; external auxlib;
- procedure auxSolidDodecahedron; external auxlib;
- procedure auxWireTeapot; external auxlib;
- procedure auxSolidTeapot; external auxlib;
- procedure auxCloseWindow; external auxlib;
- procedure auxQuit; external auxlib;
- procedure auxSetGreyRamp; external auxlib;
- function auxGetColorMapSize; external auxlib;
- function auxGetDisplayModePolicy; external auxlib;
- function auxGetDisplayModeID; external auxlib;
- procedure auxCreateFont; external auxlib;
- function auxGetDisplayMode; external auxlib;
- function auxGetHWND; external auxlib;
- function auxGetHDC; external auxlib;
- function auxGetHGLRC; external auxlib;
- procedure auxInitWindow; external auxlib name 'auxInitWindowA';
-
- end.
-
- /*
- ** Window Masks
- */
-
- #define AUX_WIND_IS_RGB(x) (((x) & AUX_INDEX) == 0)
- #define AUX_WIND_IS_INDEX(x) (((x) & AUX_INDEX) != 0)
- #define AUX_WIND_IS_SINGLE(x) (((x) & AUX_DOUBLE) == 0)
- #define AUX_WIND_IS_DOUBLE(x) (((x) & AUX_DOUBLE) != 0)
- #define AUX_WIND_IS_INDIRECT(x) (((x) & AUX_INDIRECT) != 0)
- #define AUX_WIND_IS_DIRECT(x) (((x) & AUX_INDIRECT) == 0)
- #define AUX_WIND_HAS_ACCUM(x) (((x) & AUX_ACCUM) != 0)
- #define AUX_WIND_HAS_ALPHA(x) (((x) & AUX_ALPHA) != 0)
- #define AUX_WIND_HAS_DEPTH(x) (((x) & (AUX_DEPTH24 | AUX_DEPTH16)) != 0)
- #define AUX_WIND_HAS_STENCIL(x) (((x) & AUX_STENCIL) != 0)
- #define AUX_WIND_USES_FIXED_332_PAL(x) (((x) & AUX_FIXED_332_PAL) != 0)
-
- /*
- ** ToolKit Event Structure
- */
-
- typedef struct _AUX_EVENTREC {
- GLint event;
- GLint data[4];
- } AUX_EVENTREC;
-
- /*
- ** ToolKit Event Types
- */
- #define AUX_EXPOSE 1
- #define AUX_CONFIG 2
- #define AUX_DRAW 4
- #define AUX_KEYEVENT 8
- #define AUX_MOUSEDOWN 16
- #define AUX_MOUSEUP 32
- #define AUX_MOUSELOC 64
-
- /*
- ** Toolkit Event Data Indices
- */
- #define AUX_WINDOWX 0
- #define AUX_WINDOWY 1
- #define AUX_MOUSEX 0
- #define AUX_MOUSEY 1
- #define AUX_MOUSESTATUS 3
- #define AUX_KEY 0
- #define AUX_KEYSTATUS 1
-
- /*
- ** ToolKit Event Status Messages
- */
- #define AUX_LEFTBUTTON 1
- #define AUX_RIGHTBUTTON 2
- #define AUX_MIDDLEBUTTON 4
- #define AUX_SHIFT 1
- #define AUX_CONTROL 2
-
- /*
- ** ToolKit Key Codes
- */
- #define AUX_RETURN 0x0D
- #define AUX_ESCAPE 0x1B
- #define AUX_SPACE 0x20
- #define AUX_LEFT 0x25
- #define AUX_UP 0x26
- #define AUX_RIGHT 0x27
- #define AUX_DOWN 0x28
- #define AUX_A 'A'
- #define AUX_B 'B'
- #define AUX_C 'C'
- #define AUX_D 'D'
- #define AUX_E 'E'
- #define AUX_F 'F'
- #define AUX_G 'G'
- #define AUX_H 'H'
- #define AUX_I 'I'
- #define AUX_J 'J'
- #define AUX_K 'K'
- #define AUX_L 'L'
- #define AUX_M 'M'
- #define AUX_N 'N'
- #define AUX_O 'O'
- #define AUX_P 'P'
- #define AUX_Q 'Q'
- #define AUX_R 'R'
- #define AUX_S 'S'
- #define AUX_T 'T'
- #define AUX_U 'U'
- #define AUX_V 'V'
- #define AUX_W 'W'
- #define AUX_X 'X'
- #define AUX_Y 'Y'
- #define AUX_Z 'Z'
- #define AUX_a 'a'
- #define AUX_b 'b'
- #define AUX_c 'c'
- #define AUX_d 'd'
- #define AUX_e 'e'
- #define AUX_f 'f'
- #define AUX_g 'g'
- #define AUX_h 'h'
- #define AUX_i 'i'
- #define AUX_j 'j'
- #define AUX_k 'k'
- #define AUX_l 'l'
- #define AUX_m 'm'
- #define AUX_n 'n'
- #define AUX_o 'o'
- #define AUX_p 'p'
- #define AUX_q 'q'
- #define AUX_r 'r'
- #define AUX_s 's'
- #define AUX_t 't'
- #define AUX_u 'u'
- #define AUX_v 'v'
- #define AUX_w 'w'
- #define AUX_x 'x'
- #define AUX_y 'y'
- #define AUX_z 'z'
- #define AUX_0 '0'
- #define AUX_1 '1'
- #define AUX_2 '2'
- #define AUX_3 '3'
- #define AUX_4 '4'
- #define AUX_5 '5'
- #define AUX_6 '6'
- #define AUX_7 '7'
- #define AUX_8 '8'
- #define AUX_9 '9'
-
- /*
- ** ToolKit Gets and Sets
- */
- #define AUX_FD 1 /* return fd (long) */
- #define AUX_COLORMAP 3 /* pass buf of r, g and b (unsigned char) */
- #define AUX_GREYSCALEMAP 4
- #define AUX_FOGMAP 5 /* pass fog and color bits (long) */
- #define AUX_ONECOLOR 6 /* pass index, r, g, and b (long) */
-
- extern float auxRGBMap[20][3];
-
- #define AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
- glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))
-
- typedef void (CALLBACK* AUXEXPOSEPROC)(int, int);
- void APIENTRY auxExposeFunc(AUXEXPOSEPROC);
-
- typedef void (CALLBACK* AUXKEYPROC)(void);
- void APIENTRY auxKeyFunc(int, AUXKEYPROC);
-
- typedef void (CALLBACK* AUXMOUSEPROC)(AUX_EVENTREC *);
- void APIENTRY auxMouseFunc(int, int, AUXMOUSEPROC);
-
- void APIENTRY auxGetMouseLoc(int *, int *);
- void APIENTRY auxSetOneColor(int, float, float, float);
- void APIENTRY auxSetFogRamp(int, int);
-
- void APIENTRY auxSetRGBMap(int, float *);
-
- /* Display Mode Selection Criteria */
- enum {
- AUX_USE_ID = 1,
- AUX_EXACT_MATCH,
- AUX_MINIMUM_CRITERIA
- };
-
- void APIENTRY auxInitDisplayModePolicy(GLenum);
- GLenum APIENTRY auxInitDisplayModeID(GLint);
-
-
-
-